import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
// https://vite.dev/config/
export default defineConfig({

  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  // 配置css 全局注入  
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `
          @use "@/assets/styles/variables.scss"as *;
          @use "@/assets/styles/mixins.scss"as *;
        `,
          // 配置scss版本低于2.0报错，添加以下配置
          silenceDeprecations: ['legacy-js-api']
      }
    }
  },
  plugins: [vue(),vueSetupExtend()]
})
